From: GNU Libc Maintainers Date: Sun, 1 Mar 2026 20:10:06 +0000 (+0100) Subject: submitted-nptl-invalid-td X-Git-Tag: archive/raspbian/2.41-12+rpi1+deb13u2^2~9 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/%22mailto:tmurad%40gmail.com//%22mailto:i18n-csb%40linuxcsb.org/%22/%22http:/www.example.com/%22mailto:tmurad%40gmail.com/%22mailto:i18n-csb%40linuxcsb.org/%22?a=commitdiff_plain;h=4fdc5ec07ae3bec241a81ca912924f44b3840a3e;p=glibc.git submitted-nptl-invalid-td 2010-02-27 Aurelien Jarno * pthreadP.h(INVALID_TD_P, INVALID_NOT_TERMINATED_TD_P): detect NULL pointers. Gbp-Pq: Topic any Gbp-Pq: Name submitted-nptl-invalid-td.patch --- diff --git a/sysdeps/nptl/pthreadP.h b/sysdeps/nptl/pthreadP.h index 2d620ed20..8a1679b55 100644 --- a/sysdeps/nptl/pthreadP.h +++ b/sysdeps/nptl/pthreadP.h @@ -232,8 +232,8 @@ libc_hidden_proto (__pthread_current_priority) /* This will not catch all invalid descriptors but is better than nothing. And if the test triggers the thread descriptor is guaranteed to be invalid. */ -#define INVALID_TD_P(pd) __builtin_expect ((pd)->tid <= 0, 0) -#define INVALID_NOT_TERMINATED_TD_P(pd) __builtin_expect ((pd)->tid < 0, 0) +#define INVALID_TD_P(pd) __builtin_expect (!pd || ((pd)->tid <= 0), 0) +#define INVALID_NOT_TERMINATED_TD_P(pd) __builtin_expect (!pd || ((pd)->tid < 0), 0) extern void __pthread_unwind (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute __attribute ((__noreturn__))